home *** CD-ROM | disk | FTP | other *** search
- /*
- * File: HotKeys.h
- *
- * Abstract: Interface to the HotKeys library
- *
- * Uses: HotKeys.c, HotKeys.rsrc, MacTraps
- *
- * Licensing: This code may be used without fees provided that proper
- * copyright notice given.
- *
- * History: 1.0.0 RSM 93-11-29 Created first version
- *
- * ©1993 One Step Beyond
- */
-
- #pragma once
- #ifndef __HOTKEYS__
- #define __HOTKEYS__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
-
- typedef struct{
- char onOff; // if 1, hot key is active, 0 it is inactive
- char filler; // unused
- unsigned char mods; // modifier flags, shifted 8 from event record mods
- unsigned char keyCode; // the virtual keycode
- }HotKey;
-
-
- extern short gHotKeySICNRsrcID; // change these to whatever you want
- extern short gHotKeyDLOGRsrcID;
- extern short gHotKeyStrsRsrcID;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- // Return 1 if the msg & mods match the given hotkey, 0 otherwise
-
- short IsHotKey( const HotKey*, const long msg, const short mods );
-
-
- // Set the given hotkey given the msg and mods
-
- void SetHotKey( HotKey*, const long msg, const short mods );
-
-
- // Unsets a hot key to nothing.
-
- void ClearHotKey( HotKey* );
-
-
- // Allows user to set the hot key using a "modal" dialog.
-
- void SetHotKeyDlog( HotKey* );
-
-
- // Draw the hot key's representation in the current port.
- // Note: this uses's the port's current font, size, face and colors
-
- OSErr DrawHotKey( const HotKey*, const Rect* );
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-